package ve.ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author memozac
 */
@Entity
public class ClusterScoreDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idClusterScoreDomain;

    @ManyToOne
    @JoinColumn(name="idCluster",nullable=false,updatable=true)
    private Cluster cluster;

    @ManyToOne
    @JoinColumn(name="idScoreDomain",nullable=false,updatable=true)
    private ScoreDomain scoreDomain;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Cluster getCluster() {
        return cluster;
    }

    public void setCluster(Cluster cluster) {
        this.cluster = cluster;
    }

    public Long getIdClusterScoreDomain() {
        return idClusterScoreDomain;
    }

    public void setIdClusterScoreDomain(Long idClusterScoreDomain) {
        this.idClusterScoreDomain = idClusterScoreDomain;
    }

    public ScoreDomain getScoreDomain() {
        return scoreDomain;
    }

    public void setScoreDomain(ScoreDomain scoreDomain) {
        this.scoreDomain = scoreDomain;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idClusterScoreDomain != null ? idClusterScoreDomain.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof ClusterScoreDomain)) {
            return false;
        }
        ClusterScoreDomain other = (ClusterScoreDomain) object;
        if ((this.idClusterScoreDomain == null && other.idClusterScoreDomain != null) || (this.idClusterScoreDomain != null && !this.idClusterScoreDomain.equals(other.idClusterScoreDomain))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.PersonScoreDomain[id=" + idClusterScoreDomain + "]";
    }

}//ends of class
